Skip to content

Remove overflow: hidden from border-radius utility classes#710

Open
selamw1 wants to merge 1 commit intogoogle:mainfrom
selamw1:fix/lit-renderer-text-clipping
Open

Remove overflow: hidden from border-radius utility classes#710
selamw1 wants to merge 1 commit intogoogle:mainfrom
selamw1:fix/lit-renderer-text-clipping

Conversation

@selamw1
Copy link
Contributor

@selamw1 selamw1 commented Feb 24, 2026

It fixes issue #208

This PR resolves an issue where text elements using the Lit renderer were unexpectedly clipped when rendered with rounded corners.

The border-br-* utility classes in @a2ui/web_core (which handle border-radius) were indiscriminately applying overflow: hidden. This caused clipping for content like line-height ascenders/descenders in text blocks.

This commit removes the overflow: hidden rule from the border-radius class generator, fixing the clipping while maintaining the intended rounded corners.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the overflow: hidden property from the border-radius utility classes to fix a text clipping issue. The change is logical, but it lacks corresponding tests. As per the repository's style guide, all code changes should be tested. I've added a comment to highlight the need for a test case to prevent future regressions.


.border-ow-${idx} { outline-width: ${idx}px; }
.border-br-${idx} { border-radius: ${idx * grid}px; overflow: hidden;}`;
.border-br-${idx} { border-radius: ${idx * grid}px; }`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Per the repository style guide, code changes should include tests. To prevent this text clipping issue from recurring, please consider adding a test case (e.g., a visual regression test) that verifies this fix.

References
  1. The repository style guide states: 'If there are code changes, code should have tests.' (link)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll be adding screenshot tests to more robustly test this in some future changes, but in the meantime, can you add this new test command to .github/workflows/web_build_and_test.yml so that these get executed automatically?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test command added.

@ava-cassiopeia
Copy link
Collaborator

I think you'll need to revert your changes to the package-lock file to get the checks to pass.

…text clipping

add visual regression test for border radius clipping

remove overflow hidden from border radius utility classes to prevent text clipping

add visual regression test for border radius clipping

add web_core tests to github

Stick with this version:"@types/node": "^24.10.1"

regenerate package-lock.json correctly
@selamw1 selamw1 force-pushed the fix/lit-renderer-text-clipping branch from 830f700 to 011f5eb Compare February 25, 2026 18:41
@selamw1
Copy link
Contributor Author

selamw1 commented Feb 25, 2026

Done, reverted the lock file and squashed all changes into one commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants